# !/usr/bin python3
# encoding: utf-8 -*-
# @file: cloud_1439_gasfeetest.py
# @author   : wjd
# @Time: 2024/3/11 11:04

import requests


class Cloud_1439():
    "获取OK gas fee档位"
    host = 'https://www.oklink.com'

    def test_ok_api_v5_explorer_blockchain_fee(self, chainShortName):
        self.headers = {
            'Ok-Access-Key': 'eddeb0d9-1ee6-4b32-9017-48d37b9486ed'
        }
        self.url = f'{self.host}/api/v5/explorer/blockchain/fee?chainShortName={chainShortName}'

        self.method = 'GET'
        self.data = ''

        res = requests.request(url=self.url, method=self.method, headers=self.headers, data=self.data).json()
        for i in res['data']:
            for k in i:
                print(f"【{k}】：【{i[k]}】")


if __name__ == '__main__':
    gasfee_test = Cloud_1439()
    gasfee_test.test_ok_api_v5_explorer_blockchain_fee("ETH")
